/**
 * Copyright 2020 jianggujin (www.jianggujin.com).
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.jianggujin.modulelink.util;

/**
 * 访问修饰
 * 
 * @author jianggujin
 *
 */
public class JModifier {
    /**
     * 完全开放，可以被其他模块调用
     */
    public static final int PUBLIC = 0x00000001;
    /**
     * 私有模块，只允许模块管理器调用，不允许被调用，其他模块无感知
     */
    public static final int PRIVATE = 0x00000002;
    /**
     * 受保护的模块，只允许模块管理器调用，其他模块可感知但不可调用
     */
    public static final int PROTECTED = 0x00000004;

    public static boolean isPublic(int mod) {
        return (mod & PUBLIC) != 0;
    }

    public static boolean isPrivate(int mod) {
        return (mod & PRIVATE) != 0;
    }

    public static boolean isProtected(int mod) {
        return (mod & PROTECTED) != 0;
    }
}
